package com.ruoyi.system.controller;

import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.ZhuanjiabiandongshenbaoHuifu;
import com.ruoyi.system.service.IZhuanjiabiandongshenbaoHuifuService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 专家变动申报_恢复Controller
 * 
 * @author dy
 * @date 2024-05-27
 */
@Controller
@RequestMapping("/system/zhuanjiabiandongshenbao_huifu")
public class ZhuanjiabiandongshenbaoHuifuController extends BaseController
{
    private String prefix = "system/zhuanjiabiandongshenbao_huifu";

    @Autowired
    private IZhuanjiabiandongshenbaoHuifuService zhuanjiabiandongshenbaoHuifuService;

    @RequiresPermissions("system:zhuanjiabiandongshenbao_huifu:view")
    @GetMapping()
    public String zhuanjiabiandongshenbao_huifu()
    {
        return prefix + "/zhuanjiabiandongshenbao_huifu";
    }

    /**
     * 查询专家变动申报_恢复列表
     */
    @RequiresPermissions("system:zhuanjiabiandongshenbao_huifu:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(ZhuanjiabiandongshenbaoHuifu zhuanjiabiandongshenbaoHuifu)
    {
        startPage();
        List<ZhuanjiabiandongshenbaoHuifu> list = zhuanjiabiandongshenbaoHuifuService.selectZhuanjiabiandongshenbaoHuifuList(zhuanjiabiandongshenbaoHuifu);
        return getDataTable(list);
    }

    /**
     * 导出专家变动申报_恢复列表
     */
    @RequiresPermissions("system:zhuanjiabiandongshenbao_huifu:export")
    @Log(title = "专家变动申报_恢复", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(ZhuanjiabiandongshenbaoHuifu zhuanjiabiandongshenbaoHuifu)
    {
        List<ZhuanjiabiandongshenbaoHuifu> list = zhuanjiabiandongshenbaoHuifuService.selectZhuanjiabiandongshenbaoHuifuList(zhuanjiabiandongshenbaoHuifu);
        ExcelUtil<ZhuanjiabiandongshenbaoHuifu> util = new ExcelUtil<ZhuanjiabiandongshenbaoHuifu>(ZhuanjiabiandongshenbaoHuifu.class);
        return util.exportExcel(list, "专家变动申报_恢复数据");
    }

    /**
     * 新增专家变动申报_恢复
     */
    @GetMapping("/add")
    public String add()
    {
        return prefix + "/add";
    }

    /**
     * 新增保存专家变动申报_恢复
     */
    @RequiresPermissions("system:zhuanjiabiandongshenbao_huifu:add")
    @Log(title = "专家变动申报_恢复", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave(ZhuanjiabiandongshenbaoHuifu zhuanjiabiandongshenbaoHuifu)
    {
        return toAjax(zhuanjiabiandongshenbaoHuifuService.insertZhuanjiabiandongshenbaoHuifu(zhuanjiabiandongshenbaoHuifu));
    }

    /**
     * 修改专家变动申报_恢复
     */
    @RequiresPermissions("system:zhuanjiabiandongshenbao_huifu:edit")
    @GetMapping("/edit/{shenbaoid}")
    public String edit(@PathVariable("shenbaoid") String shenbaoid, ModelMap mmap)
    {
        ZhuanjiabiandongshenbaoHuifu zhuanjiabiandongshenbaoHuifu = zhuanjiabiandongshenbaoHuifuService.selectZhuanjiabiandongshenbaoHuifuByShenbaoid(shenbaoid);
        mmap.put("zhuanjiabiandongshenbaoHuifu", zhuanjiabiandongshenbaoHuifu);
        return prefix + "/edit";
    }

    /**
     * 修改保存专家变动申报_恢复
     */
    @RequiresPermissions("system:zhuanjiabiandongshenbao_huifu:edit")
    @Log(title = "专家变动申报_恢复", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(ZhuanjiabiandongshenbaoHuifu zhuanjiabiandongshenbaoHuifu)
    {
        return toAjax(zhuanjiabiandongshenbaoHuifuService.updateZhuanjiabiandongshenbaoHuifu(zhuanjiabiandongshenbaoHuifu));
    }

    /**
     * 删除专家变动申报_恢复
     */
    @RequiresPermissions("system:zhuanjiabiandongshenbao_huifu:remove")
    @Log(title = "专家变动申报_恢复", businessType = BusinessType.DELETE)
    @PostMapping( "/remove")
    @ResponseBody
    public AjaxResult remove(String ids)
    {
        return toAjax(zhuanjiabiandongshenbaoHuifuService.deleteZhuanjiabiandongshenbaoHuifuByShenbaoids(ids));
    }
}
